#pragma once

#include "HashTable.h"

namespace xsc
{
	template<typename K,typename hash = HashFunc<K>>
	class unordered_set
	{
		struct KeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};

		typedef typename HashTable<K, const K, KeyOfT, hash>::Iterator iterator;
		typedef typename HashTable<K, const K, KeyOfT, hash>::ConstIterator const_iterator;

	public:
		iterator begin()
		{
			return ht.Begin();
		}

		iterator end()
		{
			return ht.End();
		}

		const_iterator begin() const
		{
			return ht.Begin();
		}

		const_iterator end() const
		{
			return ht.End();
		}


		pair<iterator, bool> insert(const K& key)
		{
			return ht.Insert(key);
		}

		iterator find(const K& key)
		{
			return ht.Find(key);
		}

		bool erase(const K& key)
		{
			return ht.Erase(key);
		}

	private:
		HashTable<K, const K, KeyOfT,hash> ht;
	};
}